//
//  BSKNote.m
//  MicroMemory
//
//  Created by rimi on 16/7/16.
//  Copyright © 2016年 BlueSky. All rights reserved.
//

#import "BSKNote.h"

@implementation BSKNote
- (instancetype)init
{
	self = [super init];
	if (self) {
		_latitude = -1;
		_longitude = -1;
        _isChange = YES;
        self.isChange = YES;
        self.objectID = @"";
        self.typeID = @"";
        self.userID = @"";
        self.noteID = @"";
        self.title = @"";
        self.date = @"";
        self.address = @"";
        self.subcontent = @"";
        self.noteFileName = @"";
        self.updateTime = 0;
        self.uploadTime = 0;
        self.latitude = 0;
        self.longitude = 0;
        self.weatherType = 0;
	}
	return self;
}
+ (instancetype)noteWithResultSet:(FMResultSet *)resultSet {
    BSKNote *note = [[BSKNote alloc] init];
    note.isChange = [resultSet boolForColumn:	@"isChange"];
    note.objectID = [resultSet stringForColumn:	@"objectID"];
    note.typeID = [resultSet stringForColumn:	@"typeID"];
    note.userID = [resultSet stringForColumn:	@"userID"];
    note.noteID = [resultSet stringForColumn:	@"noteID"];
    note.title = [resultSet stringForColumn:	@"title"];
    note.date = [resultSet stringForColumn:		@"date"];
    note.address = [resultSet stringForColumn:	@"address"];
    note.subcontent = [resultSet stringForColumn:	@"subcontent"];
    note.noteFileName = [resultSet stringForColumn:	@"noteFileName"];
    note.updateTime = [resultSet doubleForColumn:	@"updateTime"];
    note.latitude = [resultSet doubleForColumn:		@"latitude"];
    note.longitude = [resultSet doubleForColumn:	@"longitude"];
    note.weatherType = [resultSet intForColumn:		@"weatherType"];
    return note;
}

//-(NSString *)description{
//	return [NSString stringWithFormat:@"<BSKNote isChange:%@, objectID:%@, typeID:%@, userID:%@, noteID:%@, title:%@, date:%@, address:%@, subcontent:%@, noteFileName:%@, updateTime:%lf, latitude:%lf, longitude:%lf, weatherType:%d>",self.isChange?@"YES":@"NO",self.objectID,self.typeID,self.userID,self.noteID,self.title,self.date,self.address,self.subcontent,self.noteFileName,self.updateTime,self.latitude,self.longitude,self.weatherType];
//}
@end
